package jiachunlei.mement;

/**
 * 创建并在 Memento 对象中存储状态
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/12/8 23:23
 */
public class Originator
{
    private String state;

    public String getState()
    {
        return state;
    }

    public void setState(String state)
    {
        this.state = state;
    }

    public Memento saveStateToMemento()
    {
        return new Memento(state);
    }

    public void getStateFromMemento(Memento Memento)
    {
        state = Memento.getState();
    }
}
